package com.cnzhy.mybatis.plus.controller;

import com.cnzhy.mybatis.plus.entity.OrdUser;
import com.cnzhy.mybatis.plus.services.interfaces.OrdUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: zhaoyan5
 */
@RestController
public class OrdUserController {
    /**
     * 不推荐使用字段注入
     */
    private final OrdUserService ordUserService;

    @Autowired
    public OrdUserController(OrdUserService ordUserService) {
        this.ordUserService = ordUserService;
    }

    @GetMapping("orduser/{userId}")
    public OrdUser getCrmAdminUser(@PathVariable long userId) {
        return ordUserService.selectByUserId(userId);
    }


    @GetMapping("table/{userId}")
    public OrdUser selectTableByUserId(@PathVariable long userId) {
        return ordUserService.selectTableByUserId(userId);
    }

}
